import java.util.ArrayList;
import java.util.List;

/**
 * @author LiuShanshan
 * @version V1.0
 * @Description
 */
public class concreteSubjectdemo2 implements Subject{
    private List<Iobserverdemo2> weixinUserList = new ArrayList<>();

    @Override
    public void attach(Iobserverdemo2 observer) {
        weixinUserList.add(observer);
    }

    @Override
    public void detach(Iobserverdemo2 observer) {
        weixinUserList.remove(observer);
    }

    @Override
    public void notify(String message) {
        for (Iobserverdemo2 iObserver: weixinUserList) {
            iObserver.update(message);
        }
    }
}
